//
//  PrevationViewController.swift
//  AreaChainblock
//
//  Created by 赵佟越 on 2018/10/11.
//  Copyright © 2018年 zhaotongyue. All rights reserved.
//

import UIKit

class PrevationViewController: BaseViewController {
    
    override func viewWillAppear(_ animated: Bool) {
        self.navigationController?.setNavigationBarHidden(false, animated: true)
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        self.makeBaseUI()
        self.title = XALanguageManager.getString(key: "Preservation")
        // Do any additional setup after loading the view.
    }
    //MARK - Private Methods
    func makeBaseUI(){
        //
        self.view.backgroundColor = UIColor("#EEF0F7")
        
        
        let backView = UIView(frame: CGRect(x: 15, y: 79, width: kScreenWidth - 30, height: 85))
        backView.backgroundColor = UIColor.white
        backView.layer.cornerRadius = 5
        self.view.addSubview(backView)
        
        let photoImageView = UIImageView.init(frame: CGRect(x: 10, y: 20, width: 44, height: 44))
        backView.addSubview(photoImageView)
        photoImageView.image = UIImage.init(named: "组 1@2x")
        
        let titleLabel = UILabel.init(frame: CGRect(x: 70, y: 20, width: 44, height: 44))
        titleLabel.text = "CD"
        titleLabel.font = UIFont.boldSystemFont(ofSize: 20)
        backView.addSubview(titleLabel)
        
        
        let numberButton = PPNumberButton.init(frame: CGRect(x:kScreenWidth/2 - 50 - 15 , y: 27.5, width: 110, height: 30))
        numberButton.borderColor(UIColor.gray)
        //开启抖动动画
        numberButton.shakeAnimation = true
        numberButton.maxValue = 135
        numberButton.minValue = 1
        //加减按钮的闭包回调
        numberButton.numberResult { (number) in
            
            print(number)
        }
        
        backView.addSubview(numberButton)
        
        
        let myButton1 = UIButton()
        backView.addSubview(myButton1)
        myButton1.snp.makeConstraints { (make) in
            make.centerY.equalTo(backView)
            make.right.equalTo(backView).offset(-10)
            make.size.equalTo(CGSize(width: 80, height: 30))
        }
        myButton1.layer.cornerRadius = 15
        myButton1.backgroundColor = UIColor("#217AFF")
        myButton1.alpha = 0.7
        myButton1.titleLabel?.font = UIFont.systemFont(ofSize: 12)
        myButton1.setTitle("Preservation", for: .normal)
        
//        myButton1.addTarget(self, action: #selector(SecondViewController.), for: .touchUpInside)

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
